﻿//////////////////////////////////////////////////////////////////////////
// FileName:ucBusIDFromBusIDNO.ascx
// CreateBy:DragonXiong
// CreateDate:2010-08-03
// Description:
//		将车辆牌号转换成BusID
//      
// Modify Log:
//           
//            
// Copyright:
/////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Auto.BusMan.UserControl
{
    public partial class ucBusIDFromBusIDNO : System.Web.UI.UserControl
    {
        #region --Property--


        /// <summary>
        /// DropDownList
        /// </summary>
        public TextBox Label
        {
            get { return TextBox1; }
        }

        /// <summary>
        /// Width of Label
        /// </summary>
        public Unit Width
        {
            set { TextBox1.Width = value; }
        }

        /// <summary>
        /// BusID
        /// </summary>
        public string BusID
        {
            get 
            {
                InitControl(TextBox1.Text.Trim());
                return (ViewState["BusID"] == null) ? "" : (string)ViewState["BusID"]; 
            }
            set 
            { 
                ViewState["BusID"] = value; 
            }
        }

        /// <summary>
        /// Text
        /// </summary>
        public string Text
        {
            get { return TextBox1.Text.Trim(); }
        }
        #endregion --Property--

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// Fill the Data to the Control
        /// </summary>
        /// <param name="busIDNO">车辆牌号</param>
        private void InitControl(string busIDNO)
        {
            Auto.Data.BusMan.BLL.BusList bll = new Data.BusMan.BLL.BusList();
            string busID = bll.GetBusIDByBusIDNO(busIDNO);
            BusID = busID;
        }
    }
}